package edu.sctu.chengongsuo.student_activity;

/**
 * Created by user0 on 2015/5/28.
 */
public class DinningRoom {

    private int[] seat;
    private Window[] windows;

    public Window[] getWindows() {
        return windows;
    }


    public DinningRoom() {

        initWindows();

        initSeats();
    }

    private void initSeats() {
        seat = new int[40];

        for (int i = 0; i < 40; i++) {
            seat[i] = 0;
        }
    }

    private void initWindows() {
        windows = new Window[4];

        for (int i = 0; i < 4; i++) {

            Dish[] dishes = new Dish[4];
            dishes[0] = new Dish("青菜", 3.0f);
            dishes[1] = new Dish("回锅肉", 4.0f);
            dishes[2] = new Dish("水煮肉片", 5.0f);
            dishes[3] = new Dish("清蒸鲈鱼", 6.0f);

            windows[i] = new Window(i, dishes);
        }
    }

    public int getEmptySeat(){

        for (int i = 0; i < 40; i++) {
            if(seat[i] == 0){

                return i;
            }
        }

        return -1;
    }
}
